import json

import re

class cell_data:
    def __init__(self,data_type,value) -> None:
        self.data_type = data_type
        self.value = value

    def verify(self):
        if self.data_type == "string":
            
            try:
                self.value = str(self.value)
                if self.value.endswith(".0"):
                    self.value = self.value.replace(".0","")

                  
                self.value = str(self.value)
            except:
                return False
            
        elif self.data_type == "number":
            try:
                self.value = int(self.value)
            except:
                return False
            
        elif self.data_type == "json":
            try:
                json.loads(self.value)
            except:
                return False
        elif self.data_type == "boolean":
            return self.value == "true" or self.value == "false"
        return True